import Unitree_Python_sdk
import time
unitree_robot = Unitree_Python_sdk.Unitree_Robot_High()

motion_time = 0
while True:
    time.sleep(0.002)
    motion_time += 1

    if (motion_time < 1000):
        unitree_robot.robot_walking(forwardSpeed=0.1, sideSpeed=0.0, rotateSpeed=0.0, bodyHeight=0.0, footRaiseHeight=0.1)  # 前进
    if (motion_time >= 1000 and motion_time < 2000):
        unitree_robot.robot_walking(forwardSpeed=-0.1, sideSpeed=0.0, rotateSpeed=0.0, bodyHeight=0.0, footRaiseHeight=0.1)  # 后退
    if (motion_time >= 2000):
        unitree_robot.robot_walking(forwardSpeed = 0.0, sideSpeed = 0.0, rotateSpeed = 0.1, bodyHeight = 0.0)  # 旋转

	# state = unitree_robot.getState()  # 获取机器狗状态信息
    # print(state.imu.rpy[0])
